<template>
	<view class="content" v-if="show">
		
		
		<!-- <vi size="32"></vi> -->
		<!-- <myView height="32"></myView>
		<myImg src="/static/index/sjrz.jpg" width="686" height="340"></myImg>
		<!-- 商家入驻流程 -->
		<!-- <myTimeLine :list="applyFlows" marginTop="48"></myTimeLine> -->
		
		<!-- <myBtu  title="申请入驻" type="primary" width="686" height="72" marginTop="120" @confirm="toApply"></myBtu> --> -->
		<view class="Background_img">
			<image src="/static/index/index_bg.jpg" ></image>
		</view>
		<view class="contain" >
			<u-time-line>
					<u-time-line-item nodeTop="2" >
						<!-- 此处自定义了左边内容，用一个图标替代 -->
						<template v-slot:node>
							<view class="u-node" style="background: #FCBD71;">
								<!-- 此处为uView的icon组件 -->
								<u-icon name="pushpin-fill" color="#fff" :size="24"></u-icon>
							</view>
						</template>
						<template v-slot:content>
							<view>
								<view class="u-order-title">第一步</view>
								<view class="u-order-desc">申请入驻</view>
							</view>
							<view>
								<view class="u-order-title">第二步</view>
								<view class="u-order-desc">联系开发者</view>
							</view>
							<view>
								<view class="u-order-title">第三步</view>
								<view class="u-order-desc">完善店铺信息</view>
							</view>
						</template>
					</u-time-line-item>

				</u-time-line>
		</view>
		
		<view class="apply_buttom">
			<u-button type="primary" width="686" height="72" marginTop="120" @click="toApply">申请入驻</u-button>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: false,
				
				applyFlows:[
					{
						icon: 'photo',
						title: '第一步 申请入驻',
						content: '点击申请入驻'
					},
					{
						icon: 'photo',
						title: '第二步 联系开发者',
						content: '联系开发者提供相应信息'
					},
					{
						icon: 'photo',
						title: '第三步 完善店铺信息',
						content: '完善店铺信息，申请相关小程序，商户号等'
					}
				]
			}
		},
		
		async onLoad(options){
			console.log('options',options)
			// #ifdef MP-WEIXIN
				await this.$login();
			// #endif
			this.$log('options',options)
			// #ifdef H5
				await this.$gzhLogin();
			// #endif
			console.log('options',options)
			let needJump = await this.handleOptions(options); //配合mpShare.js实现
			this.$log(needJump);
			this.$log('我执行了');
			setTimeout(()=>{
				this.show=true;
			},2000)
			if(!needJump){
				this.show=true;
				//不需要跳转，才初始化页面
				this.init();
				// let res=await this.$u.api.getUser();
				// this.$log(res);
			}
		},
		computed: {

		},
		onShow() {
			//从别的页面返回的时候，返回到首页 如果没数据就需要初始化数据
			if(this.show){
				this.init();

			}
		},
		methods: {
			handleOptions(options){
				//处理页面传值 封装为Promise
				return new Promise((resolve,reject)=> {
					let route = options.route || '';
					console.log('route',route);
					if(!route || this.$u.test.contains("/pages/index/index",route)){
						resolve(false); 
						return;
					}
					let params;
					// #ifdef MP-WEIXIN
					if(!this.$u.test.isEmpty(options,params)){
						this.$log('options.params',options.params);
						params=JSON.parse(options.params);
						this.$log('params',params);
					}
					// #endif
					// #ifdef H5
					params=options;
					// #endif
					
					let type = 'navigateTo';
					if(this.$u.test.contains(
						"/pages/index/index,/pages/me/me",
					route)){
						type = 'swichTab'
					}
					//路由传参
					this.$u.route({
						type: type,
						url: route,
						params: params
					})
					resolve(true);
				})
			},
			async init(){
		
			},
			toApply() {
				this.$log("confirm",confirm);
				this.$u.route({
					url:'/subpages/me/form/applyForm'
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	
.content{
	  padding: 0;
	  margin: 0;
	  box-sizing: border-box;
	  height: 32;
	   

	  
}
.Background_img{
	width: 686rpx;
	height: 250rpx;
}
.contain{
	height:32rpx;
	width: 750rpx;
	margin-left: 32rpx;
	
}
.u-node {
		width: 44rpx;
		height: 44rpx;
		border-radius: 100rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		background: #d0d0d0;
		
		
	}
	
	.u-order-title {
		color: #333333;
		font-weight: bold;
		font-size: 32rpx;
	}
	
	.u-order-desc {
		color: rgb(150, 150, 150);
		font-size: 28rpx;
		margin-bottom: 6rpx;
	}
	
	.u-order-time {
		color: rgb(200, 200, 200);
		font-size: 26rpx;
	}
	
	.apply_buttom{
		
		margin-top: 400rpx;
	}
</style>

